package com.zw.a.basic.a05.demo06_this;

//学生类的测试类
public class StudentTest {
    public static void main(String[] args) {
        //1. 创建学生类的对象.
        Student s = new Student();
        //2. 调用Student#method()
        s.method();         //this.x -> s.x         10, 20
        System.out.println("-----------");

        //3. 升级版演示: 谁调用, this就代表谁.
        Student s2 = new Student();
        s2.x = 100;
        s2.method();        //this.x -> s2.x        100, 20
    }
}
